﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Mock1G3.BussinessLogic;
using Mock1G3.BaseEntities;
using Mock1G3.DataAccess;
using Test_Mock1G3.ViewHistory;

namespace Test_Mock1G3.ViewHistory
{
    /// <summary>
    /// Summary description for ValidateTest
    /// </summary>
    [TestClass]
    public class ViewHistory
    {
        public ViewHistory()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion
        [TestMethod]
        public void ViewHistory1W()
        {
            Card card = new Card();
            card.CardNo = "0123456789123457";
            string c = "0123456789123457";
            DataTable actual;
            actual = HistoryAccess.History1w(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_1wViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory1W1()
        {
            Card card = new Card();
            card.CardNo = "0123456789111111";
            string c = "0123456789111111";
            DataTable actual;
            actual = HistoryAccess.History1w(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_1wViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory1M()
        {
            Card card = new Card();
            card.CardNo = "0123456789123457";
            string c = "0123456789123457";
            DataTable actual;
            actual = HistoryAccess.History1m(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_1mViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory1M1()
        {
            Card card = new Card();
            card.CardNo = "0123456789111111";
            string c = "0123456789111111";
            DataTable actual;
            actual = HistoryAccess.History1m(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_1mViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory4M()
        {
            Card card = new Card();
            card.CardNo = "0123456789123457";
            string c = "0123456789123457";
            DataTable actual;
            actual = HistoryAccess.History4m(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_4mViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory4M1()
        {
            Card card = new Card();
            card.CardNo = "0123456789111111";
            string c = "0123456789111111";
            DataTable actual;
            actual = HistoryAccess.History4m(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_4mViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory6M()
        {
            Card card = new Card();
            card.CardNo = "0123456789123457";
            string c = "0123456789123457";
            DataTable actual;
            actual = HistoryAccess.History6m(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_6mViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory6M1()
        {
            Card card = new Card();
            card.CardNo = "0123456789111111";
            string c = "0123456789111111";
            DataTable actual;
            actual = HistoryAccess.History6m(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_6mViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory1Y()
        {
            Card card = new Card();
            card.CardNo = "0123456789123457";
            string c = "0123456789123457";
            DataTable actual;
            actual = HistoryAccess.History1y(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_1yViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory1Y1()
        {
            Card card = new Card();
            card.CardNo = "0123456789111111";
            string c = "0123456789111111";
            DataTable actual;
            actual = HistoryAccess.History1y(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_1yViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory2Y()
        {
            Card card = new Card();
            card.CardNo = "0123456789123457";
            string c = "0123456789123457";
            DataTable actual;
            actual = HistoryAccess.History2y(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_2yViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
        [TestMethod]
        public void ViewHistory2Y1()
        {
            Card card = new Card();
            card.CardNo = "0123456789111111";
            string c = "0123456789111111";
            DataTable actual;
            actual = HistoryAccess.History2y(card);
            DataTable dt = DataAccess.ExeStoredWithParamToDataTable("dbo.[usp_2yViewHistory]", "@CardNo", card.CardNo);
            Assert.IsTrue(TableComparer.CompareDataTables(dt, actual));
        }
    }

}
